2 * @file sample_update_policy.hpp
\r
3 * Contains a sample policy for list update containers.
\r
5 * Copyright Ami Tavory, IBM-HRL, 2004.
\r
7 * Permission to use, copy, modify, sell, and distribute this software
\r
8 * is hereby granted without fee, provided that the above copyright notice
\r
9 * appears in all copies, and that both that copyright notice and this
\r
10 * permission notice appear in supporting documentation.
\r
12 * None of the above authors, nor IBM Haifa Research Laboratories, make any
\r
13 * representation about the suitability of this software for any
\r
14 * purpose. It is provided "as is" without express or implied warranty.
\r
18 #ifndef SAMPLE_UPDATE_POLICY_HPP
\r
19 #define SAMPLE_UPDATE_POLICY_HPP
\r
24 * description = "A sample list-update policy."
\r
25 * comment = "This class serves to show the interface a list update functor
\r
26 * needs to support.">
\r
28 class sample_update_policy
\r
31 *******************************************************************************
\r
32 *******************************************************************************
\r
33 * <public_methods_group>
\r
37 ***************************************************************************
\r
38 ***************************************************************************
\r
39 ** <group description = "Constructors, destructor, and related.">
\r
43 * <fn description = "Default constructor."
\r
44 * comment = "Must be default constructible.">
\r
46 sample_update_policy
\r
51 * <fn description = "Copy constructor."
\r
52 * comment = "Must be copy constructible.">
\r
54 sample_update_policy
\r
55 (const sample_update_policy &r_other);
\r
59 * <fn description = "Swaps content."
\r
60 * comment = "Must be swappable (if there is such a word).">
\r
64 (sample_update_policy &r_other);
\r
68 ***************************************************************************
\r
69 ***************************************************************************
\r
74 *******************************************************************************
\r
75 *******************************************************************************
\r
76 * </public_methods_group>
\r
81 *******************************************************************************
\r
82 *******************************************************************************
\r
83 * <protected_types_group>
\r
88 ***************************************************************************
\r
89 ***************************************************************************
\r
90 ** <group description = "Metadata definitions.">
\r
94 * <tdef description = "Metadata on which this functor operates."
\r
95 * comment = "The class must declare the metadata type on which it
\r
96 * operates; the list-update based containers will append to
\r
97 * each node an object of this type.">
\r
106 ***************************************************************************
\r
107 ***************************************************************************
\r
112 *******************************************************************************
\r
113 *******************************************************************************
\r
114 * </protected_types_group>
\r
119 *******************************************************************************
\r
120 *******************************************************************************
\r
121 * <protected_methods_group>
\r
125 ***************************************************************************
\r
126 ***************************************************************************
\r
127 ** <group description = "Metadata operations.">
\r
131 * <fn description = "Creates a metadata object."
\r
132 * comment = "A list-update based container object will call this
\r
133 * method to create a metadata type when a node is created.">
\r
141 * <fn description = "Decides whether a metadata object should be
\r
142 * moved to the front of the list. A list-update based containers object
\r
144 * method to decide whether to move a node to the front of
\r
145 * the list. The method shoule return true if the node should
\r
146 * be moved to the front of the list."
\r
147 * comment = "@@sample_update_policy_metadata_reference">
\r
151 (metadata_reference r_data) const;
\r
155 ***************************************************************************
\r
156 ***************************************************************************
\r
161 *******************************************************************************
\r
162 *******************************************************************************
\r
163 * </protected_methods_group>
\r
171 #endif // #ifndef SAMPLE_UPDATE_POLICY_HPP
\r